package function.search;

public class ChainArtist {

	private ChainArtist previous;
	private ChainArtist next;
	private Artist current;
	
	
	public ChainArtist(Artist aCurrent, ChainArtist aPrevious,
			ChainArtist aNext) {
		super();
		this.previous = aPrevious;
		this.next = aNext;
		current = aCurrent;
	}

	public ChainArtist getPrevious() {
		return previous;
	}

	public ChainArtist getNext() {
		return next;
	}

	public Artist getArtist() {
		return current;
	}

	public void setNext(ChainArtist newMp3) {
		next = newMp3;
	}

	public void setPrevious(ChainArtist newMp3) {
		previous = newMp3;
	}

	public int getLength() {
		int i = 1;
		ChainArtist current = this;
		
		while (current.getNext() != null) {
			i++;
			current = current.getNext();
		}
		
		current = this;
		while (current.getPrevious() != null) {
			i++;
			current = current.getPrevious();
		}
		
		return i;
	}
}
